<?php

class pageForms extends form {

	public static function add($errors)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form name="addPage" action="" method="post">
				<fieldset>
					<legend>Add Page</legend>
					<ul>
						<li><label for="title">Title:</label><input id="title" type="text" name="title" value="' . stripslashes(self::postValue('title')) .'" /></li>
						<li><label for="url">URL: </label><input id="url" type="text" name="url" value="' . self::postValue('url') .'" /></li>
						<li><label for="content">Content: </label>' . form::textarea('content', self::postValue('content')) . '</li>
						<li><input type="submit" name="submit" value="Add Page" /></li>
					</ul>
				</fieldset>
			</form>';
			
		return $show;
	}
	
	
	public static function edit($errors, $page)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form name="editPage" action="" method="post">
				<fieldset>
					<legend>Edit Page</legend>
					<ul>
						<li><label for="title">Title:</label><input id="title" type="text" name="title" value="' . stripslashes($page->title) .'" /></li>
						<li><label for="url">URL: </label><input id="url" type="text" name="url" value="' . $page->url .'" /></li>
						<li><label for="content">Content: </label>' . form::textarea('content', $page->content) . '</li>
						<li><input type="submit" name="submit" value="Edit Page" /></li>
					</ul>
				</fieldset>
			</form>';
			
		return $show;
	}
}
?>